import {
  fuctionList,
  fetchFuctionList,
  saveFuctionList,
  deleteFuctionList,
  styleList,
  saveStyleList,
  updateStyleList,
  searchStyle,
  deleteStyleList,
  fetchStyleList
} from '@/api/service'
const resource = {
  actions: {
    // 功能管理列表
    FuctionList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        fuctionList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 获取功能信息
    FetchFuctionList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        fetchFuctionList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 保存功能信息
    SaveFuctionList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        saveFuctionList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 删除功能信息
    DeleteFuctionList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        deleteFuctionList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 获取样式列表
    StyleList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        styleList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 保存样式信息
    SaveStyleList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        saveStyleList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 修改样式信息
    UpdateStyleList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        updateStyleList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 保存样式信息
    SearchStyle({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        searchStyle(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 删除样式
    DeleteStyleList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        deleteStyleList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    // 获取样式信息
    FetchStyleList({ commit }, postselectinfo) {
      return new Promise((resolve, reject) => {
        fetchStyleList(postselectinfo).then(response => {
          resolve(response.data)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default resource
